#include"stdio.h"
#include"string.h"
main()
{
	char s[] = "Today is a nice day";
	int len = strlen(s);
	printf("the len = %d\n",len);
	int i,num=0,word = 0 ,sum = 0,count = 0;
	for(i = 0; i<len ; i++)
	{
		if(count <= sum)
			count = sum ;
		if(s[i] == ' ')
		{
			word=0;
			sum=0;
		}
		else if (word == 0)
		{
			word = 1;
			num++;
			++sum;
		}
		else
		{
			word=1;
			++sum;
		}
	}
	printf("the total world is %d ,the longest is %d\n i = %d\n",num,count,i);
	
}
